package com.naiterui.ehp.bs.search.entity;

import org.apache.commons.lang3.builder.ToStringBuilder;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
import java.io.Serializable;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 标准诊断
 *
 * @author chenlin
 */
@Entity
@Table(name = "dr_standard_diagnosis")
public class SearchDrStandardDiagnosis implements Serializable {

    private static final long serialVersionUID = 4032907293478991280L;
    /**
     * 主键
     */
    private Long id;
    /**
     * 主要编码
     */
    private String mainCode;
    /**
     * 附加编码
     */
    private String attachCode;
    /**
     * 诊断名称
     */
    private String name;
    /**
     * 诊断别名
     */
    private String alias;
    /**
     * 常用搜索词
     */
    private String commonKeywords;
    /**
     * 初识权重(常用诊断，设计上限9)
     */
    private Integer weightDef;
    /**
     * 自定义权重(设计上限51)
     */
    private Integer weightCustom;
    /**
     * 乐观锁
     */
    private Integer version;
    /**
     * 创建时间
     */
    private Date createdAt;
    /**
     * 创建人
     */
    private String createdBy;
    /**
     * 更新时间
     */
    private Date changedAt;
    /**
     * 更新人
     */
    private String changedBy;

    @Id
    @Column(name = "id", unique = true, nullable = false)
    @GeneratedValue(strategy = IDENTITY)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "main_code")
    public String getMainCode() {
        return this.mainCode;
    }

    public void setMainCode(String mainCode) {
        this.mainCode = mainCode;
    }

    @Column(name = "attach_code")
    public String getAttachCode() {
        return this.attachCode;
    }

    public void setAttachCode(String attachCode) {
        this.attachCode = attachCode;
    }

    @Column(name = "name")
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "alias")
    public String getAlias() {
        return this.alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    @Column(name = "common_keywords")
    public String getCommonKeywords() {
        return this.commonKeywords;
    }

    public void setCommonKeywords(String commonKeywords) {
        this.commonKeywords = commonKeywords;
    }

    @Column(name = "weight_def")
    public Integer getWeightDef() {
        return this.weightDef;
    }

    public void setWeightDef(Integer weightDef) {
        this.weightDef = weightDef;
    }

    @Column(name = "weight_custom")
    public Integer getWeightCustom() {
        return this.weightCustom;
    }

    public void setWeightCustom(Integer weightCustom) {
        this.weightCustom = weightCustom;
    }

    @Version
    @Column(name = "version")
    public Integer getVersion() {
        return this.version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    @Column(name = "created_at")
    public Date getCreatedAt() {
        return this.createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    @Column(name = "created_by")
    public String getCreatedBy() {
        return this.createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    @Column(name = "changed_at")
    public Date getChangedAt() {
        return this.changedAt;
    }

    public void setChangedAt(Date changedAt) {
        this.changedAt = changedAt;
    }

    @Column(name = "changed_by")
    public String getChangedBy() {
        return this.changedBy;
    }

    public void setChangedBy(String changedBy) {
        this.changedBy = changedBy;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
